package com.snow.campuslink.secondHand.service.impl;

import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.snow.campuslink.secondHand.converter.dto.UpdateSecondHandActionCountDto;
import com.snow.campuslink.secondHand.entity.SecondHandGoods;
import com.snow.campuslink.secondHand.mapper.SecondHandGoodsMapper;
import com.snow.campuslink.secondHand.service.ISecondHandGoodsService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Map;

import static cn.hutool.core.bean.BeanUtil.beanToMap;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Gaosl
 * @since 2021-02-15
 */
@Service
public class SecondHandGoodsServiceImpl extends ServiceImpl<SecondHandGoodsMapper, SecondHandGoods> implements ISecondHandGoodsService {

    @Resource
    SecondHandGoodsMapper secondHandGoodsMapper;

    @Override
    public void updateActionCount(UpdateSecondHandActionCountDto updateSecondHandActionCountDto) {
        Map<String, Object> map = beanToMap(updateSecondHandActionCountDto, true, true);
        secondHandGoodsMapper.updateActionCount(map);
    }
}
